# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=speexdsp
pkgver=1.2.0
pkgrel=0
pkgdesc="A voice compression format (DSP)"
url="https://www.speex.org/"
arch="all"
options="!check"  # No test suite.
license="BSD-3-Clause"
depends=
makedepends="autoconf automake libtool"
install=
subpackages="$pkgname-dev $pkgname-doc"
replaces="libspeex"
source="https://downloads.xiph.org/releases/speex/speexdsp-$pkgver.tar.gz"

builddir="$srcdir"/$pkgname-$pkgver
prepare() {
	cd "$builddir"
	default_prepare
	autoreconf -vif
}

build() {
	local _neon
	cd "$builddir"
	[ "$CARCH" = "aarch64" ] && _neon="--disable-neon"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--disable-static \
		$_neon
	make
}

package() {
	cd "$builddir"
	make -j1 DESTDIR="$pkgdir" install
}

sha512sums="e357cd5377415ea66c862302c7cf8bf6a10063cacd903f0846478975b87974cf5bdf00e2c6759d8f4f453c4c869cf284e9dc948a84a83d7b2ab96bd5405c05ec  speexdsp-1.2.0.tar.gz"
